###
# Elec Admin Master File
###

if (Sys.info()[['user']] == "alal") {
  root = "/home/alal/Dropbox/1_Research/ElecAdminFunding/ElecAdminFundingReplication"
} else {
  root = "~/Dropbox/ElecAdminFunding/ElecAdminFundingReplication"
}

# Install necessary packages
source(file.path(root, "code/install_packages.R"))

# Produce estimates
source(file.path(root, "code/estimation/00_estimation.R"))
source(file.path(root, "code/estimation/01_robustness.R"))
source(file.path(root, "code/estimation/01_estimation_pre_treat.R"))
source(file.path(root, "code/estimation/01_hetfx_sdid.R"))
source(file.path(root, "code/estimation/01_hetfx.R"))

# Main tables and figures
source(file.path(root, "code/tables_figures/make_maps.R"))
source(file.path(root, "code/tables_figures/make_selection_plots.R"))
source(file.path(root, "code/tables_figures/make_selection_tables.R"))
source(file.path(root, "code/tables_figures/make_main_effects_tables.R"))
source(file.path(root, "code/tables_figures/make_main_effects_plots.R"))
source(file.path(root, "code/tables_figures/make_alt_estimator_tables.R"))
source(file.path(root, "code/tables_figures/make_wi_spending_plot.R"))
source(file.path(root, "code/tables_figures/covid_by_2016.R"))
source(file.path(root, "code/tables_figures/make_2016_placebo_effects_tables.R"))
source(file.path(root, "code/tables_figures/make_within_state_table.R"))

# Main heterogeneity tables
source(file.path(root, "code/heterogeneity_tables_figures/make_battleground_effects_table.R"))
source(file.path(root, "code/heterogeneity_tables_figures/make_pop_tercile_effects_table.R"))
source(file.path(root, "code/heterogeneity_tables_figures/make_expenditure_tercile_effects_table.R"))
source(file.path(root, "code/heterogeneity_tables_figures/make_expenditure_tercile_effects_table_ebal.R"))

# Counterfactual exercise
source(file.path(root, "code/counterfactual_exercise/counterfactual_exercise.R"))
